<?php
class UsersController extends AppController{

var $scaffold;
var $name = 'Users';
var $helpers = array('Html', 'Form' );

function beforeRender(){
  if($this->action == 'index'){
      $this->viewVars['scaffoldFields'] = array('id','username');
  }
}

function beforeFilter() {
	$this->Auth->allow('register','logout');	
}

function knownusers(){
$this->set('knownusers',$this->User->findAll(null,
  array('id', 'username'), 'id DESC'));
}

function login() {
	 
}

function logout() {
    $this->redirect($this->Auth->logout());
}

function register()
{
if (!empty($this->data))
  {
    if ($this->User->save($this->data))
      {
	$this->Session->setFlash('Your registration information was accepted.');
	$this->redirect('/');
      }
  }
}
}?>